import { http } from '@/utils/http'
import type { Banner, Category, Hot } from '@/types/home'
import type { GoodsItem, PageParams, PageResult } from '@/types/global'

const getBannerList = (distributionSite = 1) => {
  return http<Banner[]>({
    method: 'GET',
    url: `/home/banner`,
    data: {
      distributionSite,
    },
  })
}

const getCategoryList = () => {
  return http<Category[]>({
    method: 'GET',
    url: `/home/category/mutli`,
  })
}

const getHotList = () => {
  return http<Hot[]>({
    method: 'GET',
    url: `/home/hot/mutli`,
  })
}

const getGuessLikeList = (pageItem?: PageParams) => {
  return http<PageResult<GoodsItem>>({
    method: 'GET',
    url: `/home/goods/guessLike`,
    data: pageItem,
  })
}

export { getBannerList, getCategoryList, getHotList, getGuessLikeList }
